<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="">
		<meta name="author" content="">
		<title>新建商品</title>
		<link rel="stylesheet" href="../../css/base.css" />
		<link rel="stylesheet" href="../../css/common.css" />
		<link href="../../sbadmin/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="../../js/weditor/aliyun-oss-sdk.js"></script>
		<script type="text/javascript" src="../../js/weditor/wangEditor.js"></script>
		<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
		<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
		<!--[if lt IE 9]>
	<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
	<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->
		<style>
			body {
				padding: 0 15px !important;
			}
		</style>
	</head>

	<body style="background:#FFF;">
		<div class="comm-tt-font pr">
			出售商品 > 新建商品
		</div>
		<div class="shop-detail-box pr">
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl"><em>*</em>封面图：</div>
				<div class="ad-form-itemcc fl">
					<img src="../../img/test2.jpg" class="adf-img">
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl"><em>*</em>商品图片：</div>
				<div class="wod-form-itemcc fl">
					<div class="sale-detailimg2">
						<img src="../../img/test2.jpg">
					</div>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl"><em>*</em>商品编号：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl"><em>*</em>商品名：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl"><em>*</em>售价：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl"><em>*</em>指导价：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl"><em>*</em>拍摄次数：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">拍摄张数：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">精修张数：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">服装数量：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">场景数量：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">相册：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">摄影师：</div>
				<div class="wod-form-itemcc fl">
					<select class="eic-select" style="width: 200px;"></select>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">有效期：</div>
				<div class="wod-form-itemcc fl">
					<input type="text" class="edit-input" />
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">出售门店：</div>
				<div class="wod-form-itemcc fl">
					<select class="eic-select" style="width: 200px;"></select>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">可使用门店：</div>
				<div class="wod-form-itemcc fl">
					<select class="eic-select" style="width: 200px;"></select>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">是否上架：</div>
				<div class="wod-form-itemcc fl">
					<select class="eic-select" style="width: 200px;"></select>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">特别说明：</div>
				<div class="wod-form-itemcc fl">
					<textarea class="ed-textarea"></textarea>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl" id="spsss">商品详情：</div>
				<div class="wod-form-itemcc2 fl" style="width: 1000px;">
					<div id="editor"></div>
					<textarea id="etextarea" name="details" style="display: none;"></textarea>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">备注：</div>
				<div class="wod-form-itemcc fl">
					<textarea class="ed-textarea"></textarea>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl">温馨提示：</div>
				<div class="wod-form-itemcc fl">
					<textarea class="ed-textarea"></textarea>
				</div>
			</div>
			<div class="wo-form-item clb mt20">
				<div class="ad-form-itemtt fl"></div>
				<div class="wod-form-itemcc fl">
					<div class="clb mt20">
						<a href="#" class="fl commqx-btn">取消</a>
						<a href="javascript:void(0);" class="fl commqr-btn ml15" id="qrbtn">确定</a>
					</div>
				</div>
			</div>

		</div>
		<input type="file" name="picFieldName" id="picFieldId" onchange="uploadPic(this)" />
		<!-- jQuery -->
		<script src="../../sbadmin/bower_components/jquery/dist/jquery.min.js"></script>
		<!-- Bootstrap Core JavaScript -->
		<script src="../../sbadmin/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
		<!-- Metis Menu Plugin JavaScript -->
		<script src="../../sbadmin/bower_components/metisMenu/dist/metisMenu.min.js"></script>
		<!-- DataTables JavaScript -->
		<script src="../../sbadmin/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
		<script src="../../sbadmin/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>
		<!-- Custom Theme JavaScript -->
		<script src="../../sbadmin/dist/js/sb-admin-2.js"></script>
		<!-- Page-Level Demo Scripts - Tables - Use for reference -->
	</body>
	<script>
		var client;
		$.ajax({
			url: "https://order.wz1996.wang/wzbg/media/sts",
			type: 'get',
			success: function(data) {
				console.log(data)

			}
		});
		client = new OSS({
			region: 'oss-cn-shanghai',
			accessKeyId: "LTAII5jRBBNopeGX",
			accessKeySecret: "rJNnG4J9q4EYRqW5FKinvi5pi2pQ1r",
			stsToken: data.data.credentials.securityToken,
			bucket: 'wangzheng1996'
		});
		
		function uploadPic(obj) {
			var file = obj.files[0]; //获取文件流
			var val = obj.value;
			var suffix = val.substr(val.indexOf("."));
			var storeAs = "wangzheng1996/" + timestamp() + suffix;
			console.log(file.name + ' => ' + storeAs);
			console.log(client);
			client.multipartUpload(storeAs, file).then(function(result) {
				console.log(result);
			}).catch(function(err) {
				console.log(err);
			});
		}
		/**
		 * 生成文件名
		 * @returns
		 */
		function timestamp() {
			var time = new Date();
			var y = time.getFullYear();
			var m = time.getMonth() + 1;
			var d = time.getDate();
			var h = time.getHours();
			var mm = time.getMinutes();
			var s = time.getSeconds();
			console.log(y);
			return "" + y + add0(m) + add0(d) + add0(h) + add0(mm) + add0(s);
		}

		function add0(m) {
			return m < 10 ? '0' + m : m;
		}
	</script>

</html>